package com.yk.framework.gui.wf.model;

import java.awt.Point;

import javax.swing.JLabel;

/**
 * @author lifetime
 * 
 */
public class ConditionNode {
	public Point startPoint;
	public Point endPoint;
	public Point centerPoint;
	public String name;
	public String id;
	public JLabel lbl;

	public ConditionNode() {
	}

	public Point getStartPoint() {
		return startPoint;
	}

	public void setStartPoint(Point startPoint) {
		this.startPoint = startPoint;
	}

	public Point getEndPoint() {
		return endPoint;
	}

	public void setEndPoint(Point endPoint) {
		this.endPoint = endPoint;
	}

	public Point getCenterPoint() {
		if (centerPoint == null && startPoint != null && endPoint != null) {
			centerPoint = new Point();
			centerPoint.x = startPoint.x + (endPoint.x - startPoint.x) / 2;
			centerPoint.y = startPoint.y + (endPoint.y - startPoint.y) / 2;
		}
		return centerPoint;
	}

	public void setCenterPoint(Point centerPoint) {
		this.centerPoint = centerPoint;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public JLabel getLbl() {
		return lbl;
	}

	public void setLbl(JLabel lbl) {
		this.lbl = lbl;
	}

}
